package com.fjd.controller;

import com.fjd.entity.DeliveryDetail;
import com.fjd.entity.DeliveryDetailHistory;
import com.fjd.result.Result;
import com.fjd.service.DeliveryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@Api(tags = "物流相关接口")
@RequestMapping("/shopping/delivery")
public class DeliveryController {

    @Autowired
    private DeliveryService deliveryService;
    @ApiOperation("获取订单对应物流信息")
    @GetMapping("/{orderId}")
    public Result<List<DeliveryDetailHistory>> deliveryDetail(@PathVariable String orderId){
         List<DeliveryDetailHistory> deliveryDetailHistoryList = deliveryService.getDeliveryDetail(orderId);
         return Result.success(deliveryDetailHistoryList);
    }
}
